/*
 * @Description: 
 * @Author: shuliang
 * @Date: 2022-05-06 10:26:08
 * @LastEditTime: 2022-05-10 11:57:41
 * @LastEditors: shuliang
 */
import { MockMethod } from 'vite-plugin-mock';
import { resultPageSuccess } from '../_util';
const Mock = require('mockjs')

const demoList = Mock.mock({
  "array|60": [
    {
      'id':'@id',
      "userName|+1": [
        "admin",
        "test"
      ],
      "userNickname|+1": [
        "我是管理员",
        "我是普通用户"
      ],
      "roleSign|+1": [
        "admin",
        "common"
      ],
      "department|+1": [
        ['vueNextAdmin', 'IT外包服务'] ,
        ['vueNextAdmin', '资本控股']
      ],
      "phone|10000000000-99999999999":12345678900,
      'email':'vueNextAdmin@123.com',
      "sex|+1": [
        "男",
        "女"
      ],
      "password":'123456',
      "overdueTime": '@date()',
	    "status|1": true,
        "describe|+1": [
                "不可删除",
                "测试用户"
            ],
		"createTime": '@datetime()',
    }
  ]
}).array

export default [
  {
    url: '/api/table/userList',
    timeout: 100,
    method: 'get',
    response: ({ query }: any) => {
      const { page = 1, pageSize = 20 } = query;
      return resultPageSuccess(page, pageSize, demoList);
    },
  },
] as MockMethod[];
